home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / os30 / gfx / tmapdemo.lha / profile.i < prev    next >
Text File  |  1992-12-14  |  812b  |  35 lines

  1.     include    'exec/types.i'
  2.     include 'exec/semaphores.i'
  3.  
  4.     STRUCTURE    ProfileSem,SS_SIZE
  5.     APTR    ps_ProfileCounters
  6.     APTR    ps_ProfileTask        ; pointer to profiling task for signalling
  7.     APTR    ps_WatchTask        ; task being watched or 0
  8.     ULONG     ps_stack_pc_offset    ; offset of PC in interrupt stack frame.
  9.     APTR    ps_ExecBase
  10.     LABEL    ps_SIZEOF
  11.  
  12. CTR_ALWAYS    equ    0                ; always incremented unelss the semaphore is held
  13. CTR_USUALLY    equ    CTR_ALWAYS+1    ; incremented on task match
  14. CTR_ANYROM    equ    CTR_USUALLY+1
  15. CTR_NONIDLE    equ    CTR_ANYROM+1
  16. CTR_SW        equ    CTR_NONIDLE+1    ; 32 software counters
  17. CTR_FIRSTROM    equ    CTR_SW+32    ; and 128K rom counters
  18.  
  19. ONTIMER    macro    bitnum
  20.     ifd    PROFILE
  21.     ifne    PROFILE
  22.     or.l    #(1<<\1),$0
  23.     endc
  24.     endc
  25.     endm
  26.  
  27. OFFTIMER    macro    bitnum
  28. ;; only handles 0-7!
  29.     ifd    PROFILE
  30.     ifne    PROFILE
  31.     and.l    #$ffffffff-(1<<\1),$0
  32.     endc
  33.     endc
  34.     endm
  35.